//player.js

var player = {
    x: 50, 	//spawn X
    y: 500, 	//spawn Y
    yaw: 0, 	//degrees 
    width: 20,
    height: 30,
    sprite: Sprite("steve"),

    //Player draw
    draw: function () {
        this.sprite.draw(canvas, this.x, this.y);
    },

    faceLeft: function () {
    
    },    

    faceUp: function () {

    },

    faceRight: function () {

    },

    faceDown: function () {

    },

    //Player shoot
    shoot: function () {
        Sound.play("shoot");

        var shotPosition = this.midpoint();

        playerShots.push(Shot({
            speed: 5,
            x: shotPosition.x,
            y: shotPosition.y
        }));
    },

    //Player explode
    explode: function () {
        this.active = false;
        //Steve dies. Game Over..
    },


    //Player midpoint
    midpoint: function () {
        return {
            x: this.x + this.width / 2,
            y: this.y + this.height / 2
        };
    }
};      //PLAYER